home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 41.zip
/
BS1 part 41
/
Lattice C v5.02 d4.adf
/
examples
/
debugger
/
status.cpr
< prev
next >
Wrap
Text File
|
1988-11-07
|
1KB
|
51 lines
/* Show all CLI tasks */
NULL = "00000000"x
dosbase = findlib("dos.library")
rootnode = import(offset(dosbase,34),4)
tasktable = d2c(c2d(import(rootnode,4))*4,4)
taskcount = c2d(import(tasktable,4))
do tasknum = 1 to taskcount
proc = import(offset(tasktable,tasknum*4),4)
if (proc ~= NULL) then
do
proc = offset(proc,-92)
cli = d2c(c2d(import(offset(proc,172),4))*4,4)
command = 'No command loaded'
args = ''
if (cli ~= NULL) then
do
cmdname = d2c(c2d(import(offset(cli,16),4))*4,4)
cmdlen = c2d(import(cmdname, 1))
if cmdlen ~= 0 then
do
command = 'Command:' import(offset(cmdname,1), cmdlen)
cis = d2c(c2d(import(offset(cli,32),4))*4,4)
cptr = d2c(c2d(import(offset(cis,12),4))*4,4)
args = import(cptr,80)
args = translate(args,"'"||'0a0a'x,'"'||'0d00'x)
y = pos('0a'x, args)
if (y ~= 0) then args = left(args,y-1)
end
end
'd "Process' tasknum||': 0x'||c2x(proc) command args'"'
end
end
exit(0)
/* Find a given library in the system */
findlib:
parse arg tofind
execbase = import("00000004"x,4)
liboff = 378
nodebase = import(offset(execbase, liboff), 4)
do while(import(nodebase,4) ~= NULL)
namestr = import(import(offset(nodebase,10),4))
if namestr = tofind then return nodebase
nodebase = import(nodebase,4)
end
'd "Could not find' tofind||'"'
exit(0)